package com.medusa.aps.business.modules.basic.mp.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.math.BigDecimal;

/**
 * <p>
 * 供应商物料表
 * </p>
 *
 * @author baomidou
 * @since 2023-09-06
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false, of = "materialCode")
@TableName("supplier_material")
public class SupplierMaterial extends Model<SupplierMaterial> {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Schema(description = "主键")
    private Long id;

    /**
     * 供应商id
     */
    @Schema(description = "供应商id")
    private Long supplierId;


    /**
     * 物料id
     */
    @Schema(description = "物料id")
    private Long materialId;

    /**
     * 物料编码
     */
    @Alias("物料编码")
    @Schema(description = "物料编码")
    @Length(max = 20, message = "物料编码长度不能超过20")
    @NotBlank(message = "物料编码不能为空")
    private String materialCode;

    /**
     * 物料名称
     */
    @Alias("物料名称")
    @Schema(description = "物料名称")
    @Length(max = 50, message = "物料名称长度不能超过50")
    @NotBlank(message = "物料名称不能为空")
    private String materialName;

    /**
     * 成品率
     */
    @Alias("成品率")
    @Schema(description = "成品率")
    private BigDecimal finishedProductRate;

    /**
     * 准交率
     */
    @Alias("准交率")
    @Schema(description = "准交率")
    private BigDecimal quasiDeliveryRate;

    /**
     * 供应商编码
     */
    @TableField(exist = false)
    private String supplierCode;


}
